package com.example.shengyin.frontController;

import com.example.shengyin.entity.Symtype;
import com.example.shengyin.service.SymtypeService;
import com.example.shengyin.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("front/symtype")
@Validated
@Api(tags = "SymtypeFrontController", description = "症状类型")
public class FrontSymtypeController {
    @Autowired
    private SymtypeService service;

    @GetMapping("/allSymtype")
    @ApiOperation("获得所有大的症状类型")
    public Result allSymtyp(){
        List<Symtype> symtypes = service.allSymtyp();
        return symtypes==null?Result.error("无数据"):Result.success(symtypes);
    }

}
